<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;



/**
 * 倍投控制器
 */
class DoubleThrow extends AdminBase
{

    /**
     * 倍投列表
     */
    public function ThrowList()
    {

        $where = $this->logicDoubleThrow->getWhere($this->param);
        $this->assign('list', $this->logicDoubleThrow->getDoubleThrowList($where, 'a.*', 'a.create_time desc'));
        $this->assign('param',$this->param);
        return $this->fetch('throw_list');
    }



    /**
     * 倍投添加
     */
    public function ThrowAdd()
    {

        $this->ThrowCommon();
        return $this->fetch('throw_edit');
    }

    /**
     * 倍投编辑
     */
    public function ThrowEdit()
    {

        $this->ThrowCommon();

        $info = $this->logicDoubleThrow->getDoubleThrowInfo(['a.id' => $this->param['id']], 'a.*');

        $this->assign('info', $info);

        return $this->fetch('throw_edit');
    }








    /**
     * 倍投添加与编辑通用方法
     */
    public function ThrowCommon()
    {

        IS_POST && $this->jump($this->logicDoubleThrow->DoubleThrowEdit($_POST));
        $this->assign('param',  $this->param);
    }



    /**
     * 数据状态设置
     */
    public function setStatus()
    {

        $this->jump($this->logicAdminBase->setStatus('PlanUserThrow', $this->param));
    }
    /**
     * 数据状态设置
     */
    public function setSort()
    {

        $this->jump($this->logicAdminBase->setSort('PlanUserThrow', $this->param));
    }
   

    /**
     * 数据状态设置
     */
    public function update_info()
    {
        $this->jump($this->logicDoubleThrow->update_info($this->param));
    }




}
